package com.codeplateform.service.impl;

import java.util.*;
import com.codeplateform.dao.CodeFunctionDao;
import com.codeplateform.dao.entity.CodeFunction;
import com.codeplateform.service.CodeFunctionService;
import org.apache.commons.lang3.ObjectUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class CodeServiceImpl implements CodeFunctionService {

    @Autowired
    CodeFunctionDao codeFunctionDao;

    @Override
    public int insert(CodeFunction codeFunction) {
        return codeFunctionDao.insert(codeFunction);
    }

    @Override
    public List<CodeFunction> selectCode(CodeFunction codeFunction) {

        List<CodeFunction> codeFunctions = codeFunctionDao.selelctByLimite(codeFunction);

        if (null != codeFunctions && codeFunctions.size() > 0){
            return codeFunctions;
        }
            return null;
    }



    @Override
    public List<CodeFunction> selelctByLimite(CodeFunction codeFunction) {

        return codeFunctionDao.selelctByLimite(codeFunction);
    }
}
